

import request from '@/utils/request'

export default {

    saveGoldBank(bankData){
        return request({
            url: `/goldAccumulate/addBank`,
            method: 'post',
            contentType:'application/json',
            data:{
                id: bankData.id,
                icon: bankData.icon,
                bankName: bankData.bankName,
                quotaTime: bankData.quotaTime,
                quotaDay: bankData.quotaDay
            }
        })
    },
 

    deleteTotallyById(ids){
        return request({
            url: `/goldAccumulate/completely`,
            method: 'post',
            contentType:"application/json",
            data: ids
            
            
        })
    },

    recoverOne(ids){
        return request({
            url: `/goldAccumulate/recover`,
            method: 'post',
            params: {
                id:ids
            }
        })
    },

    getGoldRecycleListPage(page,goldShowQuery){
        return request({
            url: `/goldAccumulate/deleteData`,
            method: 'get',
            params: {
                page: page,
                name: goldShowQuery.anyKeyWords,
            
            }
        })
    },

    updateGoldProduct(addData){
        return request({
            url: `/goldAccumulate/update`,
            method: 'put',
            params:{
             
                id:addData.id,
                costRule:addData.costRule,
                productName: addData.productName,
                issuer: addData.issuer,
                goldPrice:addData.goldPrice,
                riskGrade:addData.riskGrade,
                monetary:addData.monetary,
                ageRange:addData.ageRange,
                receivePrice:addData.receivePrice,
                receiveDate:addData.receiveDate,
                tradeDate:addData.tradeDate,
                exchange:addData.exchange,
                interestRule:addData.interestRule,
                introduction:addData.introduction,
                minMonetary:addData.minMonetary,
                type:addData.type,
                arp:addData.arp,
                serverCharge:addData.serverCharge,
                commission:addData.commission,
                amount:addData.amount,
                endHour:addData.endHour,
                startHour:addData.startHour,
                startTime:addData.startTime,
                endTime:addData.endTime

            }
        })
    },

    getGoldProudct(ids){
      
        return request({
            url: `/goldAccumulate/selectOne`,
            method: 'get',
            params:{
                id: ids
            }
        })
    },


    saveAddProduct(addData){
        return request({
            url: `/goldAccumulate/insert`,
            method: 'post',
            data:{
                endHour:addData.endHour,
                startHour:addData.startHour,
                startTime:addData.startTime,
                endTime:addData.endTime,

                id:addData.id,
                costRule:addData.costRule,
                productName: addData.productName,
                issuer: addData.issuer,
                goldPrice:addData.goldPrice,
                riskGrade:addData.riskGrade,
                monetary:addData.monetary,
                ageRange:addData.ageRange,
                receivePrice:addData.receivePrice,
                receiveDate:addData.receiveDate,
                tradeDate:addData.tradeDate,
                exchange:addData.exchange,
                interestRule:addData.interestRule,
                introduction:addData.introduction,
                minMonetary:addData.minMonetary,
                type:addData.type,
                arp:addData.arp,
                serverCharge:addData.serverCharge,
                commission:addData.commission,
                amount:addData.amount

           
            }
           
        })
    },

    getRiskGradeAndGoldAPIType(){
        return request({
            url: `/goldAccumulate/goldAPIType`,
            method: 'get'
           
        })
    },

    //获取教育头条分页列表
    getCustomerShowListPage(page,limit,customerShowQuery) {
        return request({
            url: `/goldAccumulate/selectAll`,
            method: 'get',
            params: {
                page: page, 
                name: customerShowQuery.name,
                upTime: customerShowQuery.startTime,
                timeLimit: customerShowQuery.endTime,
                limit:limit
            }
        })
    },
    //移除教育头条到回收站或者删除
    stopOrOpen(id, accountState) {
        return request({
            url: `/goldAccumulate/goodsShelves`,
            method: 'put',
            data: {
                id: id,
                accountState: accountState
            }
        })
    },
    //批量删除教育头条
    deleteBatchesById(checkList) {
        return request({
            url: `/goldAccumulate/delete`,
            method: 'post',
            data: {
               ids: checkList
            }

        })
    },
    //编辑教育头条
    editCustomerShow(id) {
        return request({
            url: `/customer/selectCustomerAndOrder`,
            method: 'post',
            data: {
                id: id
            }

        })
    }

}